package planet.comun;

import java.util.StringTokenizer;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//import com.sun.tools.ws.processor.model.Request;

public class Util {
	
	// Util.getSimpleName(fichero.getName())
	public static String getSimpleName(String cadena){
		StringTokenizer str = new StringTokenizer(cadena,"\\");
		String name=str.nextToken();
		while(str.hasMoreTokens()){
			name=str.nextToken();
		}
		return name;
	}
	
	// Util.getRutaRaiz()   C:   rutaRaiz
	public static String getRutaRaiz(){
		String so = System.getProperty("os.name");  
        	if(so.contains("Windows")){
        		return "c:\\tmp\\";
        	}else{
        		return "/tmp/";
        	}
     	}
       
	public static String getordonexley(){
		//win4.20 D:\\Apache Software Foundation\\Tomcat 5.5\\webapps\\SICOPRI.war\\ARCHIVOS\\
		//win4.20 D:/Apache Software Foundation/Tomcat 5.5/webapps/SICOPRI.war/ARCHIVOS/
		//win.nex C:\\JBossEAP\\jboss-eap-5.0\\jboss-as\\server\\default\\deploy\\SICOPRI.war\\ARCHIVOS\\
		//win.nex C:/JBossEAP/jboss-eap-5.0/jboss-as/server/default/deploy/SICOPRI.war/ARCHIVOS/
		
		String so = System.getProperty("os.name");  
	    if(so.contains("Windows")){
	        return "\\";
	    }else{
	         return "/";
	    }
	}
	
	public static String getnex1(){
	String so = System.getProperty("os.name");  
    	if(so.contains("Windows")){
        	return "C:\\jboss-eap-5.0\\jboss-as\\server\\default\\deploy\\SICOPRI.war\\ARCHIVOS\\";
    	}else{
    		return "/home/jboss/jboss-eap-5.0/jboss-as/server/default/deploy/SICOPRI.war/ARCHIVOS/";
    		//"jboss-eap-5.0/jboss-as/server/default/deploy/SICOPRI.war/ARCHIVOS/";
    	}
 	}
	
	public static String getnex2(){
		String so = System.getProperty("os.name");  
	    if(so.contains("Windows")){
	        return "C:/jboss-eap-5.0/jboss-as/server/default/deploy/SICOPRI.war/ARCHIVOS/";
	    }else{
	         return "/home/jboss/jboss-eap-5.0/jboss-as/server/default/deploy/SICOPRI.war/ARCHIVOS/";
	    }
	 }
   

}

